import http from '@/utils/http'

//获取详情商品数据
export const getDetailAPI = (proid:any)=>{
return  http.get(`/api/pro/detail/${proid}`)
}


//获取购物车列表
export const getCartListAPI = (userid:any)=>{
  return  http.post(`/api/cart/list`,{
    userid
  })
  }
//加入购物车
export const getAddCartAPI = (userid:any,proid:any,num:any)=>{
  return  http.post(`/api/cart/add`,{
    userid,proid,num
  })
  }

//删除购物车
export const getRemoveCartAPI = (cartid:any)=>{
  return  http.post(`/api/cart/remove`,{
    cartid
  })
  }

//更新购物车数量
export const updateCarNumAPI = (cartid:any,num:any)=>{
  return  http.post(`/api/cart/updatenum`,{
    cartid,num
  })
  }

// /更新所有购物车数据的选中状态
export const selectAllAPI = (userid:any,type:any)=>{
  return  http.post(`/api/cart/selectall`,{
    userid,type
  })
  } 

//更新当前购物车数据的选中状态
export const selectOneAPI = (cartid:any,flag:any)=>{
  return  http.post(`/api/cart/selectone`,{
    cartid,flag
  })
  } 
  
 

